<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>pytest—基础知识 | Threadv</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="pytest—基础知识 测试文件命名规则   测试文件应当命名为test_.py 或者 _test.py 测试函数、测试类方法应该命名为test_ 测试类应该命名为Test   测试函数返回的结果类型   PASSED(.) 测试通过 FAILED(F) 测试失败（也有可能是XPASS状态与strict选项冲突造成的失">
<meta name="keywords" content="pytest">
<meta property="og:type" content="article">
<meta property="og:title" content="pytest—基础知识">
<meta property="og:url" content="http://yoursite.com/2019/08/03/pytes_基础/index.html">
<meta property="og:site_name" content="Threadv">
<meta property="og:description" content="pytest—基础知识 测试文件命名规则   测试文件应当命名为test_.py 或者 _test.py 测试函数、测试类方法应该命名为test_ 测试类应该命名为Test   测试函数返回的结果类型   PASSED(.) 测试通过 FAILED(F) 测试失败（也有可能是XPASS状态与strict选项冲突造成的失败） SKIPPED(s) 测试未被执行，指定跳过执行可以将测试标记为@pyte">
<meta property="og:updated_time" content="2020-03-29T11:01:38.418Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="pytest—基础知识">
<meta name="twitter:description" content="pytest—基础知识 测试文件命名规则   测试文件应当命名为test_.py 或者 _test.py 测试函数、测试类方法应该命名为test_ 测试类应该命名为Test   测试函数返回的结果类型   PASSED(.) 测试通过 FAILED(F) 测试失败（也有可能是XPASS状态与strict选项冲突造成的失败） SKIPPED(s) 测试未被执行，指定跳过执行可以将测试标记为@pyte">
  
    <link rel="alternate" href="/atom.xml" title="Threadv" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
</head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Threadv</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Suche"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-pytes_基础" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/08/03/pytes_基础/" class="article-date">
  <time datetime="2019-08-03T05:07:26.000Z" itemprop="datePublished">2019-08-03</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      pytest—基础知识
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h5 id="pytest—基础知识"><a href="#pytest—基础知识" class="headerlink" title="pytest—基础知识"></a>pytest—基础知识</h5><ol>
<li><strong>测试文件命名规则</strong></li>
</ol>
<ul>
<li>测试文件应当命名为test_<something>.py 或者 <something>_test.py</something></something></li>
<li>测试函数、测试类方法应该命名为test_<something></something></li>
<li>测试类应该命名为Test<something></something></li>
</ul>
<ol>
<li><strong>测试函数返回的结果类型</strong></li>
</ol>
<ul>
<li>PASSED(.) 测试通过</li>
<li>FAILED(F) 测试失败（也有可能是XPASS状态与strict选项冲突造成的失败）</li>
<li>SKIPPED(s) 测试未被执行，指定跳过执行可以将测试标记为@pytest.mark.skip(),或者使用@pytest.mark.skipif()指定跳过测试的条件</li>
<li>xfail(x) 预期测试失败，并且确实失败，使用@pytest.mark.xfail()指定你认为会失败的测试用例</li>
<li>XPASS(X) 预期测试失败，但实际上通过，不符合预期</li>
<li>ERROR(E) 测试用例之外的代码触发了异常，可能由fixture引起，也可能由hook函数引起</li>
</ul>
<ol>
<li><strong>运行测试用例命令</strong></li>
</ol>
<ul>
<li><p>pytest -v git_test_project/test_case/test_a.py（执行文件中所有case）</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">G:\vchen\github\project\project&gt;pytest -v git_test_project/test_case/test_a.py</span><br><span class="line">=============================== test session starts ===============================</span><br><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- d:\python3\python.exe</span><br><span class="line">cachedir: .pytest_cache</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 4 items                            </span><br><span class="line"></span><br><span class="line">git_test_project/test_case/test_a.py::test_01 SKIPPED                         [ 25%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_02 SKIPPED                         [ 50%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_03 FAILED                          [ 75%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_04 PASSED                          [100%]</span><br><span class="line"></span><br><span class="line">================================= FAILURES ========================================</span><br><span class="line"></span><br><span class="line">___________________________ test_03 ___________________________</span><br><span class="line"></span><br><span class="line">    @pytest.mark.unfinished</span><br><span class="line">    def test_03():</span><br><span class="line"><span class="meta">&gt;</span><span class="bash">       assert (1,2,3) == (3,2,1)</span></span><br><span class="line">E       assert (1, 2, 3) == (3, 2, 1)</span><br><span class="line">E         At index 0 diff: 1 != 3</span><br><span class="line">E         Full diff:</span><br><span class="line">E         - (1, 2, 3)</span><br><span class="line">E         ?  ^     ^</span><br><span class="line">E         + (3, 2, 1)</span><br><span class="line">E         ?  ^     ^</span><br><span class="line"></span><br><span class="line">git_test_project\test_case\test_a.py:14: AssertionError</span><br><span class="line">================= 1 failed, 1 passed, 2 skipped, 1 warnings in 0.07 seconds =================</span><br></pre></td></tr></table></figure>
</li>
<li><p>pytest -v git_test_project/test_case/test_a.py::test_01 （执行文件单个case test_01）</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- d:\python3\python.exe</span><br><span class="line">cachedir: .pytest_cache</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 1 item                                                                                                            </span><br><span class="line">git_test_project/test_case/test_a.py::test_01 PASSED                    [100%]</span><br></pre></td></tr></table></figure>
</li>
</ul>
<ol>
<li><strong>命令行的选项</strong>  可使用pytest –help 查看全部选项</li>
</ol>
<ul>
<li><p>–tb=no : 关闭错误信息回溯</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">G:\vchen\github\project\project&gt;pytest -v --tb=no</span><br><span class="line">=========================== test session starts ===========================</span><br><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- d:\python3\python.exe</span><br><span class="line">cachedir: .pytest_cache</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 4 items                     </span><br><span class="line"></span><br><span class="line">git_test_project/test_case/test_a.py::test_01 SKIPPED                         [ 25%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_02 SKIPPED                         [ 50%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_03 FAILED                          [ 75%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_04 PASSED                          [100%]</span><br><span class="line"></span><br><span class="line">=========== 1 failed, 1 passed, 2 skipped, 1 warnings in 0.15 seconds ====================</span><br></pre></td></tr></table></figure>
</li>
<li><p>–collect-only : 使用–collect-only 选项可以展示在给定的配置下哪些测试用例会被运行</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">G:\vchen\github\project\project&gt;pytest --collect-only</span><br><span class="line">======================== test session starts ==============================</span><br><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 2 items                                    </span><br><span class="line"></span><br><span class="line">&lt;Package G:\vchen\github\project\project\git_test_project\test_case&gt;</span><br><span class="line">  &lt;Module test_a.py&gt;</span><br><span class="line">    &lt;Function test_01&gt;</span><br><span class="line">    &lt;Function test_02&gt;</span><br><span class="line">    </span><br><span class="line">====================== no tests ran in 0.40 seconds ========================</span><br></pre></td></tr></table></figure>
</li>
<li><p>-k : 允许使用表达式指定希望运行的测试用例</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">G:\vchen\github\project\project&gt;pytest -k "test_01 or test_02" --collect-only</span><br><span class="line">================================test session starts ==================================</span><br><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 2 items             </span><br><span class="line"></span><br><span class="line">&lt;Package G:\vchen\github\project\project\git_test_project\test_case&gt;</span><br><span class="line">  &lt;Module test_a.py&gt;</span><br><span class="line">    &lt;Function test_01&gt;</span><br><span class="line">    &lt;Function test_02&gt;</span><br><span class="line"></span><br><span class="line">============================ no tests ran in 0.13 seconds ============================</span><br></pre></td></tr></table></figure>
</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">pytest -k "test_01 or test_02"</span><br><span class="line">=================================== test session starts ===============================</span><br><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 2 items                                 </span><br><span class="line"></span><br><span class="line">git_test_project\test_case\test_a.py ..                        [100%]</span><br><span class="line"></span><br><span class="line">================================ 2 passed in 0.10 seconds =============================</span><br></pre></td></tr></table></figure>
<ul>
<li>-m : 标记（marker）用于标记测试并分组，以便快速选中并运行<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> pytest</span><br><span class="line"></span><br><span class="line"><span class="meta">@pytest.mark.finished</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">test_01</span><span class="params">()</span>:</span></span><br><span class="line">...</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="meta">@pytest.mark.unfinished</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">test_03</span><span class="params">()</span>:</span></span><br><span class="line">...</span><br></pre></td></tr></table></figure>
</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">G:\vchen\github\project\project&gt;pytest --verbose  git_test_project/test_case/test_a.py -m "finished and unfinished"</span><br><span class="line">====================== test session starts =====================</span><br><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- d:\python3\python.exe</span><br><span class="line">cachedir: .pytest_cache</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 4 items / 4 deselected                </span><br><span class="line"></span><br><span class="line">===============4 deselected, 2 warnings in 0.02 seconds  ====================</span><br></pre></td></tr></table></figure>
<ul>
<li>-x : 正常情况，pytest 会运行每一个搜索到的测试用例。如果某个测试函数被断言失败，或者触发了外部异常，则该测试用例的运行就会到此为止<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@pytest.mark.unfinished</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">test_03</span><span class="params">()</span>:</span></span><br><span class="line">    <span class="keyword">assert</span> (<span class="number">1</span>,<span class="number">2</span>,<span class="number">3</span>) == (<span class="number">3</span>,<span class="number">2</span>,<span class="number">1</span>)</span><br><span class="line">    ...</span><br></pre></td></tr></table></figure>
</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line">G:\vchen\github\project\project&gt;pytest -x -v</span><br><span class="line">========================== test session starts ==========================</span><br><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- d:\python3\python.exe</span><br><span class="line">cachedir: .pytest_cache</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 4 items                                  </span><br><span class="line"></span><br><span class="line">git_test_project/test_case/test_a.py::test_01 SKIPPED                   [ 25%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_02 SKIPPED                   [ 50%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_03 FAILED                    [ 75%]</span><br><span class="line"></span><br><span class="line">================================= FAILURES =================================</span><br><span class="line">_______________________________ test_03 _______________________________</span><br><span class="line"></span><br><span class="line">    @pytest.mark.unfinished</span><br><span class="line">    def test_03():</span><br><span class="line"><span class="meta">&gt;</span><span class="bash">       assert (1,2,3) == (3,2,1)</span></span><br><span class="line">E       assert (1, 2, 3) == (3, 2, 1)</span><br><span class="line">E         At index 0 diff: 1 != 3</span><br><span class="line">E         Full diff:</span><br><span class="line">E         - (1, 2, 3)</span><br><span class="line">E         ?  ^     ^</span><br><span class="line">E         + (3, 2, 1)</span><br><span class="line">E         ?  ^     ^</span><br><span class="line"></span><br><span class="line">git_test_project\test_case\test_a.py:14: AssertionError</span><br><span class="line"></span><br><span class="line">==============1 failed, 2 skipped, 1 warnings in 0.13 seconds ==================</span><br></pre></td></tr></table></figure>
<ul>
<li><p>–maxfail=num : -x特点是一旦遇到失败就会全局停止。使用–maxfail可以明指定失败几次</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">G:\vchen\github\project\project&gt;pytest -v git_test_project/test_case/test_a.py  --maxfail=2 --tb=no</span><br><span class="line">============================== test session starts ==============================</span><br><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- d:\python3\python.exe</span><br><span class="line">cachedir: .pytest_cache</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 4 items               </span><br><span class="line"></span><br><span class="line">git_test_project/test_case/test_a.py::test_01 SKIPPED                           [ 25%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_02 SKIPPED                           [ 50%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_03 FAILED                            [ 75%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_04 PASSED                            [100%]</span><br><span class="line"></span><br><span class="line">================= 1 failed, 1 passed, 2 skipped, 1 warnings in 0.05 seconds =================</span><br></pre></td></tr></table></figure>
</li>
<li><p>-s与–capture=method : -s 允许终端在测试运行时输出某些结果，包括任何符合标准的输出流信息。-s等价于–capture=no。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> pytest</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">test_01</span><span class="params">()</span>:</span></span><br><span class="line">    print(<span class="string">"222222222"</span>)</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">test_02</span><span class="params">()</span>:</span></span><br><span class="line">       print(<span class="string">"222222222"</span>)</span><br><span class="line"></span><br><span class="line"><span class="meta">@pytest.mark.unfinished</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">test_03</span><span class="params">()</span>:</span></span><br><span class="line">    <span class="keyword">assert</span> (<span class="number">1</span>,<span class="number">2</span>,<span class="number">3</span>) == (<span class="number">3</span>,<span class="number">2</span>,<span class="number">1</span>)</span><br><span class="line">    print(<span class="string">"222222222"</span>)</span><br><span class="line"></span><br><span class="line"><span class="meta">@pytest.mark.unfinished</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">test_04</span><span class="params">()</span>:</span></span><br><span class="line">    print(<span class="string">"222222222"</span>)</span><br></pre></td></tr></table></figure>
</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">G:\vchen\github\project\project&gt;pytest git_test_project/test_case -sv --tb=no</span><br><span class="line">================================ test session starts ================================</span><br><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- d:\python3\python.exe</span><br><span class="line">cachedir: .pytest_cache</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 4 items        </span><br><span class="line"></span><br><span class="line">git_test_project/test_case/test_a.py::test_01 222222222</span><br><span class="line">PASSED</span><br><span class="line">git_test_project/test_case/test_a.py::test_02 222222222</span><br><span class="line">PASSED</span><br><span class="line">git_test_project/test_case/test_a.py::test_03 FAILED</span><br><span class="line">git_test_project/test_case/test_a.py::test_04 222222222</span><br><span class="line">PASSED</span><br><span class="line"></span><br><span class="line">======================= 1 failed, 3 passed, 1 warnings in 0.06 seconds =========================</span><br></pre></td></tr></table></figure>
<ul>
<li><p>-lf(–last-failed) : 当一个或多个测试失败时，定位到最后一个失败的测试用例并重新运行</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">G:\vchen\github\project\project&gt;pytest --lf -v --tb=no</span><br><span class="line">================================= test session starts ===========================================</span><br><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- d:\python3\python.exe</span><br><span class="line">cachedir: .pytest_cache</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 4 items / 3 deselected / 1 selected                  </span><br><span class="line"></span><br><span class="line">run-last-failure: rerun previous 1 failure (skipped 66 files)</span><br><span class="line">git_test_project/test_case/test_a.py::test_03 FAILED                                  [100%]</span><br><span class="line">======================= 1 failed, 3 deselected, 1 warnings in 0.11 seconds =======================</span><br></pre></td></tr></table></figure>
</li>
<li><p>–ff(–failed-first) : 与lf作用基本相同，不同在于–ff会运行完剩余的测试用例</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">G:\vchen\github\project\project&gt;pytest --ff -v --tb=no</span><br><span class="line">===================================== test session starts ======================================</span><br><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- d:\python3\python.exe</span><br><span class="line">cachedir: .pytest_cache</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 4 items                         </span><br><span class="line"></span><br><span class="line">run-last-failure: rerun previous 1 failure first</span><br><span class="line"></span><br><span class="line">git_test_project/test_case/test_a.py::test_03 FAILED                                 [ 25%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_01 PASSED                                 [ 50%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_02 PASSED                                 [ 75%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_04 PASSED                                 [100%]</span><br><span class="line"></span><br><span class="line">======================== 1 failed, 3 passed, 1 warnings in 0.13 seconds ========================</span><br></pre></td></tr></table></figure>
</li>
<li><p>-v(–verbose) : 输出信息更详细。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">G:\vchen\github\project\project&gt;pytest -v --tb=no</span><br><span class="line">=================================== test session starts ===================================</span><br><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- d:\python3\python.exe</span><br><span class="line">cachedir: .pytest_cache</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 4 items            </span><br><span class="line"></span><br><span class="line">git_test_project/test_case/test_a.py::test_01 PASSED                                   [ 25%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_02 PASSED                                   [ 50%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_03 FAILED                                   [ 75%]</span><br><span class="line">git_test_project/test_case/test_a.py::test_04 PASSED                                   [100%]</span><br><span class="line"></span><br><span class="line">====================== 1 failed, 3 passed, 1 warnings in 0.13 seconds =======================</span><br></pre></td></tr></table></figure>
</li>
<li><p>-q(–quiet) : 与-v/–verbose作用相反，简化输出信息</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">G:\vchen\github\project\project&gt;pytest -q</span><br><span class="line">..F.                                                                 [100%]</span><br><span class="line">================================= FAILURES =================================</span><br><span class="line"></span><br><span class="line">__________________________________ test_03 __________________________________</span><br><span class="line"></span><br><span class="line">    @pytest.mark.unfinished</span><br><span class="line">    def test_03():</span><br><span class="line"><span class="meta">&gt;</span><span class="bash">       assert (1,2,3) == (3,2,1)</span></span><br><span class="line">E       assert (1, 2, 3) == (3, 2, 1)</span><br><span class="line">E         At index 0 diff: 1 != 3</span><br><span class="line">E         Full diff:</span><br><span class="line">E         - (1, 2, 3)</span><br><span class="line">E         ?  ^     ^</span><br><span class="line">E         + (3, 2, 1)</span><br><span class="line">E         ?  ^     ^</span><br><span class="line"></span><br><span class="line">git_test_project\test_case\test_a.py:12: AssertionError</span><br><span class="line"></span><br><span class="line">1 failed, 3 passed, 1 warnings in 0.12 seconds</span><br></pre></td></tr></table></figure>
</li>
<li><p>-l(–showlocals) : </p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">G:\vchen\github\project\project&gt;pytest -l</span><br><span class="line">========================== test session starts ==========================</span><br><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 4 items                       </span><br><span class="line"></span><br><span class="line">git_test_project\test_case\test_a.py ..F.                                [100%]</span><br><span class="line">=================================== FAILURES ===================================</span><br><span class="line">__________________________________________ test_03 ______________________________</span><br><span class="line"></span><br><span class="line">    @pytest.mark.unfinished</span><br><span class="line">    def test_03():</span><br><span class="line"><span class="meta">&gt;</span><span class="bash">       assert (1,2,3) == (3,2,1)</span></span><br><span class="line">E       assert (1, 2, 3) == (3, 2, 1)</span><br><span class="line">E         At index 0 diff: 1 != 3</span><br><span class="line">E         Use -v to get the full diff</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">git_test_project\test_case\test_a.py:12: AssertionError</span><br><span class="line"></span><br><span class="line">============== 1 failed, 3 passed, 1 warnings in 0.14 seconds =================</span><br></pre></td></tr></table></figure>
</li>
<li><p>–tb=style : 决定捕捉到失败时输出信息的显示方式。常用类型short,line,no</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">short: 仅输出assert的一行以及系统判定内容（不显示上下文）</span><br><span class="line">line: 只使用一行输出显示所有的错误信息</span><br><span class="line">no： 直接屏蔽全部回溯信息</span><br><span class="line">long: 输出详尽回溯信息</span><br><span class="line">auto: 默认值，如果多个测试用例失败，仅打印第一个和最后一个用例的回溯信息（格式与long模式一致）</span><br><span class="line">native： 只输出python标准库的回溯信息，不显示额外信息</span><br></pre></td></tr></table></figure>
</li>
<li><p>–duration=N :  加快测试节奏。不关心测试如何运行，只统计测试过程中哪几个阶段是最慢的（包括每个测试用例的call,setup,teardown过程）。显示最慢的N个阶段耗时越长越靠前。如果使用–duration=0，则会将所有阶段按耗时从长到短排序后显示。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br></pre></td><td class="code"><pre><span class="line">G:\vchen\github\project\project&gt;pytest git_test_project/test_case -sv --durations=3</span><br><span class="line">===================================== test session starts =====================================</span><br><span class="line">platform win32 -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- d:\python3\python.exe</span><br><span class="line">cachedir: .pytest_cache</span><br><span class="line">rootdir: G:\vchen\github\project\project</span><br><span class="line">plugins: allure-pytest-2.8.0</span><br><span class="line">collected 4 items      </span><br><span class="line"></span><br><span class="line"></span><br><span class="line">git_test_project/test_case/test_a.py::test_01 222222222</span><br><span class="line">PASSED</span><br><span class="line">git_test_project/test_case/test_a.py::test_02 222222222</span><br><span class="line">PASSED</span><br><span class="line">git_test_project/test_case/test_a.py::test_03 FAILED</span><br><span class="line">git_test_project/test_case/test_a.py::test_04 222222222</span><br><span class="line">PASSED</span><br><span class="line"></span><br><span class="line">======================================== FAILURES ========================================</span><br><span class="line">________________________________________ test_03 __________________________________________</span><br><span class="line"></span><br><span class="line">    @pytest.mark.unfinished</span><br><span class="line">    def test_03():</span><br><span class="line"><span class="meta">&gt;</span><span class="bash">       assert (1,2,3) == (3,2,1)</span></span><br><span class="line">E       assert (1, 2, 3) == (3, 2, 1)</span><br><span class="line">E         At index 0 diff: 1 != 3</span><br><span class="line">E         Full diff:</span><br><span class="line">E         - (1, 2, 3)</span><br><span class="line">E         ?  ^     ^</span><br><span class="line">E         + (3, 2, 1)</span><br><span class="line">E         ?  ^     ^</span><br><span class="line"></span><br><span class="line">git_test_project\test_case\test_a.py:14: AssertionError</span><br><span class="line"></span><br><span class="line">==================================== slowest 3 test durations ====================================</span><br><span class="line">5.00s call     git_test_project/test_case/test_a.py::test_04</span><br><span class="line">3.00s call     git_test_project/test_case/test_a.py::test_01</span><br><span class="line"></span><br><span class="line">(0.00 durations hidden.  Use -vv to show these durations.)</span><br><span class="line">======================== 1 failed, 3 passed, 1 warnings in 8.25 seconds ==========================</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">&lt;!--more--&gt;</span><br></pre></td></tr></table></figure>
</li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/08/03/pytes_基础/" data-id="ckcc4z32e004jm4uwxky9b3lv" class="article-share-link">Teilen</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/pytest/">pytest</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2019/10/26/python_序列/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Neuer</strong>
      <div class="article-nav-title">
        
          python-序列
        
      </div>
    </a>
  
  
    <a href="/2019/06/12/linux/linux常用命令/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Älter</strong>
      <div class="article-nav-title">linux常用命令</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Design-Patterns/">Design Patterns</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Git/">Git</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Html/">Html</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Http/">Http</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/JavaScript/">JavaScript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Sort/">Sort</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/algorithm/">algorithm</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ali-weixin-pay/">ali/weixin pay</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/docker/">docker</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/elasticsearch/">elasticsearch</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/go/">go</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo/">hexo</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/idea/">idea</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/java/">java</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/jvm/">jvm</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/">linux</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/logstash/">logstash</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mysql/">mysql</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/php/">php</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/pytest/">pytest</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/python/">python</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/springboot/">springboot</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/util/">util</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/vue/">vue</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/wechat/">wechat</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/我的世界/">我的世界</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/消息队列/">消息队列</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/线程/">线程</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/Design-Patterns/" style="font-size: 16.36px;">Design Patterns</a> <a href="/tags/Git/" style="font-size: 10px;">Git</a> <a href="/tags/Html/" style="font-size: 10px;">Html</a> <a href="/tags/Http/" style="font-size: 12.73px;">Http</a> <a href="/tags/JavaScript/" style="font-size: 15.45px;">JavaScript</a> <a href="/tags/Sort/" style="font-size: 18.18px;">Sort</a> <a href="/tags/algorithm/" style="font-size: 11.82px;">algorithm</a> <a href="/tags/ali-weixin-pay/" style="font-size: 13.64px;">ali/weixin pay</a> <a href="/tags/docker/" style="font-size: 17.27px;">docker</a> <a href="/tags/elasticsearch/" style="font-size: 10px;">elasticsearch</a> <a href="/tags/go/" style="font-size: 11.82px;">go</a> <a href="/tags/hexo/" style="font-size: 10px;">hexo</a> <a href="/tags/idea/" style="font-size: 10px;">idea</a> <a href="/tags/java/" style="font-size: 20px;">java</a> <a href="/tags/jvm/" style="font-size: 11.82px;">jvm</a> <a href="/tags/linux/" style="font-size: 18.18px;">linux</a> <a href="/tags/logstash/" style="font-size: 12.73px;">logstash</a> <a href="/tags/mysql/" style="font-size: 14.55px;">mysql</a> <a href="/tags/php/" style="font-size: 11.82px;">php</a> <a href="/tags/pytest/" style="font-size: 10px;">pytest</a> <a href="/tags/python/" style="font-size: 13.64px;">python</a> <a href="/tags/springboot/" style="font-size: 17.27px;">springboot</a> <a href="/tags/util/" style="font-size: 19.09px;">util</a> <a href="/tags/vue/" style="font-size: 10px;">vue</a> <a href="/tags/wechat/" style="font-size: 10.91px;">wechat</a> <a href="/tags/我的世界/" style="font-size: 10px;">我的世界</a> <a href="/tags/消息队列/" style="font-size: 10.91px;">消息队列</a> <a href="/tags/线程/" style="font-size: 11.82px;">线程</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archiv</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/05/">May 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/04/">April 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/03/">March 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/01/">January 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/10/">October 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/08/">August 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/06/">June 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/">April 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/03/">March 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/02/">February 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/01/">January 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/12/">December 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/11/">November 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/10/">October 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/09/">September 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/07/">July 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/06/">June 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/05/">May 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/04/">April 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/03/">March 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/02/">February 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/01/">January 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/12/">December 2017</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">letzter Beitrag</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2020/05/17/linux/linux_shell/">linux—shell</a>
          </li>
        
          <li>
            <a href="/2020/05/16/linux/linux_awk_sed/">linux-awk\sed 示例</a>
          </li>
        
          <li>
            <a href="/2020/04/11/linux/linux_bash/">linux—bash</a>
          </li>
        
          <li>
            <a href="/2020/03/29/hello-world/">Hello World</a>
          </li>
        
          <li>
            <a href="/2020/03/16/go安装和配置/">go安装和配置</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2020 vchen<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>



  </div>
</body>
</html>